package com.tiancheng.trade.payment.vo.admin;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 查询退款
 */
@Getter
@Setter
public class PaymentRefundFlowQueryVo implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * 退款流水号
     */
    private String flowId;

    /**
     * 对应的支付流水号
     */
    private String payFlowId;

    /**
     * 退款订单号
     */
    private String paymentId;

    /**
     * 退款状态
     */
    private String refundStatus;

    /**
     * 渠道
     */
    private String paymentChannel;

    /**
     * 退款开始时间
     */
    private LocalDate flowTimeBegin;

    /**
     * 退款结束时间
     */
    private LocalDate flowTimeEnd;

    /**
     * 创建开始时间
     */
    private LocalDate createTimeBegin;

    /**
     * 创建结束时间
     */
    private LocalDate createTimeEnd;

    /**
     * 当前页
     */
    Integer currentPage;

    /**
     * 页大小
     */
    Integer pageSize;

    public Integer getCurrentPage() {
        if (null == currentPage || currentPage < 0) {
            currentPage = 1;
        }
        return currentPage;
    }

    public Integer getPageSize() {
        if (null == pageSize || pageSize <= 0) {
            pageSize = 10;
        }
        return pageSize;
    }

    public String getPaymentId() {
        if (StringUtils.isNotEmpty(paymentId)) {
            paymentId = paymentId.trim();
        }
        return paymentId;
    }

    public String getFlowId() {
        if (StringUtils.isNotEmpty(flowId)) {
            flowId = flowId.trim();
        }
        return flowId;
    }

    public String getPayFlowId() {
        if (StringUtils.isNotEmpty(payFlowId)) {
            payFlowId = payFlowId.trim();
        }
        return payFlowId;
    }

}
